﻿using System;
namespace BinarySearchTree
{
    class TreeNode<T> : IComparable<T>, IComparable<TreeNode<T>>
        where T : IComparable<T>
    {
        public T Value { get; set; }

        public TreeNode(T value)
        {
            this.Value = value;
        }

        public override string ToString()
        {
            return Value.ToString();
        }

        public int CompareTo(T other)
        {
            return this.Value.CompareTo(other);
        }

        public int CompareTo(TreeNode<T> other)
        {
            return this.Value.CompareTo(other.Value);
        }
    }
}
